package top.zhangjianyong.blog.utils;

import cn.hutool.core.util.StrUtil;

/**
 * 脱敏工具
 *
 * @author zhangjianyong
 * @since 2024/8/27 上午10:27
 */
public class DesensitizationUtil {

  public static String ip(String str) {
    if (StrUtil.isBlank(str)) return str;
    return str.replaceAll("([0-9]+).[0-9]+.[0-9]+.([0-9]+)", "$1.*.*.$2");
  }
}
